package com.example.smartcity.Mappers;

import com.example.smartcity.Entity.Advice;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface AdviceMapper {
    @Insert("insert into advice(uid,username,content) values(#{uid},#{username},#{content})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    void InsertAdvice(Advice advice); // 插入建议
    @Update("update advice set reply = #{reply} where id = #{id}")
    void ReplyAdvice(String reply,int id); // 回复建议
    @Select("select * from advice")
    List<Advice> findAll();
}
